<html>
<head><meta charset="utf-8"><title>name of sub parts of a type · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/name.20of.20sub.20parts.20of.20a.20type.html">name of sub parts of a type</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="239134385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/name%20of%20sub%20parts%20of%20a%20type/near/239134385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/name.20of.20sub.20parts.20of.20a.20type.html#239134385">(May 17 2021 at 18:05)</a>:</h4>
<p>Hi, this might not be necessarily Rust specific but imagine I have a type <code>T</code>. It could be a tuple or adt with lots of different types for its fields. What's the right terminology for referring to these sub parts that make up the type.</p>
<p>For a more concrete example, imagine I'm trying to talk about the <code>needs_drop::&lt;T&gt;</code> intrinsic. It tries to recurse through the "inner types" in <code>T</code> looking to see whether <code>T</code> or its "inner types" have a <code>Drop</code> implementation. I'm using "inner types" here because I don't know what the proper term for this is.</p>



<a name="239135985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/name%20of%20sub%20parts%20of%20a%20type/near/239135985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Mobius <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/name.20of.20sub.20parts.20of.20a.20type.html#239135985">(May 17 2021 at 18:15)</a>:</h4>
<p>How does "field types" sound?</p>



<a name="239136534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/name%20of%20sub%20parts%20of%20a%20type/near/239136534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/name.20of.20sub.20parts.20of.20a.20type.html#239136534">(May 17 2021 at 18:18)</a>:</h4>
<p>I thought about that, but is it generic enough. Is it correct to talk about "field types" when <code>T</code> is an enum.</p>



<a name="239137001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/name%20of%20sub%20parts%20of%20a%20type/near/239137001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Mobius <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/name.20of.20sub.20parts.20of.20a.20type.html#239137001">(May 17 2021 at 18:21)</a>:</h4>
<p>Well, if it has structural types, that enum has fields :)</p>



<a name="239137921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/name%20of%20sub%20parts%20of%20a%20type/near/239137921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/name.20of.20sub.20parts.20of.20a.20type.html#239137921">(May 17 2021 at 18:28)</a>:</h4>
<p>ok you've convinced me, thank you</p>



<a name="239139647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/name%20of%20sub%20parts%20of%20a%20type/near/239139647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/name.20of.20sub.20parts.20of.20a.20type.html#239139647">(May 17 2021 at 18:41)</a>:</h4>
<p>existing terminology for this is "constituent types" or "contained types"</p>



<a name="239139892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/name%20of%20sub%20parts%20of%20a%20type/near/239139892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Hughes <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/name.20of.20sub.20parts.20of.20a.20type.html#239139892">(May 17 2021 at 18:43)</a>:</h4>
<p>Aha. Thanks I had "constituent type" in my head but couldn't work out if I'd made that up or not. Must have picked it up from prodding around in rustc</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>